<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 3.新制作一个注册页面，要求：
      3.1 包含用户名，密码，性别，学院，爱好，自我介绍及提交按钮
      3.2 包含:输入框，密码框，单选框，多选框，文本域，下拉列表
      3.3 每个需要提交的标签都要有name值
      3.4 按照name的方式查找各个元素
      3.5 按照标签的方式查找各个元素 -->
     <form action="" method="POST">
         <table>
             <tr>
                 <td>
                     用户名：<input type="text" name="username" value="">
                 </td>
             </tr>
             <tr>
                 <td>
                     密码：&nbsp; &nbsp;<input type="password" name="psd"  value="">
                 </td>
             </tr>
             <tr>
                 <td>
                     性别: &nbsp;&nbsp;&nbsp;<input type="radio" name="sex" value="male">男
                          <input type="radio" name="sex" value="female">女
                 </td>
             </tr>
             <tr>
                 <td>
                     学院：
                     <select name="xueyuan" id="">
                         <option value="1">城乡建筑学院</option>
                         <option value="2">信息与制造学院</option>
                         <option value="3">软件工程学院</option>
                     </select>
                 </td>
             </tr>
             <tr>
                 <td>
                    爱好：
                    <input type="checkbox" name="test1" value="A1">上网
                    <input type="checkbox" name="test2" value="A2">游泳
                    <input type="checkbox" name="test3" value="A3">做编程
                    <input type="checkbox" name="test4" value="A4">写作
                 </td>
             </tr>
             <tr>
                 <td>
                    介绍：
                      <textarea name="info" cols="30" rows="10"></textarea>
                 </td>
             </tr>
             <tr>
                 <td>
                     <input type="submit" name="b2" value="提交">
                 </td>
             </tr>
         </table>
     </form>
</body>
<script type="text/javascript">
   //按照name的方式查找元素
   var unaObject = document.getElementsByName('username')
   console.log(unaObject)
   var psdObject = document.getElementsByName('psd')
   console.log(psdObject)
   var sexObject =document.getElementsByName('sex')
   console.log(sexObject)
   var colloge_1 = document.getElementsByName('xueyuan')
   console.log(colloge_1)
   var hobbyObject1 = document.getElementsByName('test1')
   console.log(hobbyObject1)
   var hobbyOject2 = document.getElementsByName('test2')
   console.log(hobbyOject2)
   var hobbyObject3 = document.getElementsByName('test3')
   console.log(hobbyObject3)
   var hobbyObject4 = document.getElementsByName('test4')
   console.log(hobbyObject4)
   var textarea_1 = document.getElementsByName('info')
   console.log(textarea_1)
   var submit_1 = document.getElementsByName('b2')
   console.log(submit_1)
   //使用标签的方式进行查找元素
   var Input_1 = document.getElementsByTagName('input')
   console.log(Input_1)
   var Select_1 = document.getElementsByTagName('select')
   console.log(Select_1)
   var textarea_11 = document.getElementsByTagName('textarea')
   console.log(textarea_11)
</script>
</html>